package com.warm.pump.module.monitor.service.impl;

import com.warm.pump.frame.gen.bean.PageBean;
import com.warm.pump.module.monitor.bean.po.gen.MisfireInform;
import com.warm.pump.module.monitor.dao.gen.MisfireInformDao;
import com.warm.pump.module.monitor.service.IMisfireInformService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;


@Service("MisfireInformService")
public class MisfireInformServiceImpl implements IMisfireInformService {
    @Autowired
    private MisfireInformDao misfireInformDao;

    @Override
    public MisfireInform queryObject(Long id) {
        return misfireInformDao.selectByPrimaryKey(id);
    }

    public MisfireInform queryObject(Map<String, Object> map) {
        return misfireInformDao.selectByMap(map);
    }

    @Override
    public List<MisfireInform> queryList(Map<String, Object> map) {
        return misfireInformDao.getListByMap(map);
    }

    @Override
    public PageBean getPageBeanByMap(Map map, int pageNo, int pageSize) {
        return misfireInformDao.getPageBeanByMap(map, pageNo, pageSize);
    }


    @Override
    public int queryTotal(Map<String, Object> map) {
        return misfireInformDao.countTotalByMap(map);
    }

    @Override
    public void save(MisfireInform misfireInform) {
        misfireInformDao.insertSelective(misfireInform);
    }

    @Override
    public void update(MisfireInform misfireInform) {
        misfireInformDao.updateByPrimaryKeySelective(misfireInform);
    }

    @Override
    public void delete(Long id) {
        misfireInformDao.deleteByPrimaryKey(id);
    }

    @Override
    public void delete(Map<String, Object> map) {
        misfireInformDao.deleteByMap(map);
    }

    @Override
    public void deleteBatch(Long[] ids) {
        Map<String, Object> map = new HashMap<>();
        map.put("id_in", ids);
        misfireInformDao.deleteByMap(map);
    }

}
